﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Resto.CostControl.Core.Facade.SiteModule.DataTransferObject;
using Resto.CostControl.Core.Cache;
using Resto.CostControl.Core.Enums;

namespace Resto.CostControl.Core.Query.SiteModule.ViewObject
{
    [Serializable]
    public class SiteCostVO
    {
        #region 基本属性

        public string ID { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime BeginDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime EndDate { get; set; }

        /// <summary>
        /// 预计成本
        /// </summary>
        public decimal ExpectedCost {get;set;}

        /// <summary>
        /// 实际成本
        /// </summary>
        public decimal? ActualCost { get; set; }


        /// <summary>
        /// 记录的状态
        /// </summary>
        internal string StateCode { get; set; }

        /// <summary>
        /// 记录的状态
        /// </summary>
        public DataState State
        {
            get
            {
                return (DataState)Enum.Parse(typeof(DataState), this.StateCode);
            }
        }

        /// <summary>
        /// 项目点Id
        /// </summary>
        public string SiteId { get; set; }

        /// <summary>
        /// 项目点名称
        /// </summary>
        public string SiteName
        {
            get
            {
                SiteDTO siteDTO = SiteDTOCache.Get(SiteId);
                if (siteDTO != null)
                    return siteDTO.Name;
                else
                    return string.Empty;
            }
        }

        #endregion
    }
}
